var fcCommunTypeFtp="FTP";
var fcCommunTypeFtps="FTPS";
var fcCommunTypeMsMQ="MSMQ";
var fcCommunTypeIBMMQ="IBMMQ";
var fcCommunTypeActiveMQ="ACTIVEMQ";
var fcCommunTypeHornetQ="HORNETQ";
var fcCommunTypeSFtp="SFTP";
var fcCommunTypeFile="FILE";
var splitter="$";
var escape="\\";

function _$(id){
	return document.getElementById(id).value.replace(/[$]/g,"\\$$");
}
function splitCommunParam(communParam){
	var ret = new Array(0);
	var length = communParam.length;
	var s="";
	var c = '\0';
	var duplicate=1;
	if (length==1){
		ret.push(communParam);
		return ret;
	}
	for (var i=0;i<length;i++){
		c = communParam.charAt(i);
		if(c==splitter){
			ret.push(s);
			s="";
			continue;
		}else{
			if(c==escape){
				duplicate=1;
				while ((i<length-1) && communParam.charAt(i+1)==escape) {
					duplicate++;
					i++;
				}				
				for(var j=0; j<duplicate/2; j++) {
					s+=escape;				
				}
				if (duplicate % 2==1) {
					if (i<length-1){
						if (communParam.charAt(i+1)==splitter){
							s+=splitter;
							i++;
						}
					}
				}				
			}else{
				s+=c;
			}
		}
	}
	if(s.length>0){
		ret.push(s);
		s="";
	}
	if (c == splitter) {
		ret.push(s);
	}
	return ret;
}
function show(){
	var fcCommunType = document.getElementById('fcCommunType');
	if(fcCommunType.value!=""){
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeFtp){
			var light=document.getElementById('lightFtp');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeFtps){
			var light=document.getElementById('lightFtps');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeMsMQ){
			var light=document.getElementById('lightMsMQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeIBMMQ){
			var light=document.getElementById('lightIBMMQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeActiveMQ){
			var light=document.getElementById('lightActiveMQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeHornetQ){
			var light=document.getElementById('lightHornetQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeSFtp){
			var light=document.getElementById('lightSFtp');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeFile){
			var light=document.getElementById('lightFile');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		
	}
}
function hide(type){
	if(type==fcCommunTypeFtp){
		var light=document.getElementById('lightFtp');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
	if(type==fcCommunTypeFtps){
		var light=document.getElementById('lightFtps');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
	if(type==fcCommunTypeMsMQ){
		var light=document.getElementById('lightMsMQ');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
	if(type==fcCommunTypeIBMMQ){
		var light=document.getElementById('lightIBMMQ');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
	if(type==fcCommunTypeActiveMQ){
		var light=document.getElementById('lightActiveMQ');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
	if(type==fcCommunTypeHornetQ){
		var light=document.getElementById('lightHornetQ');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
	if(type==fcCommunTypeSFtp){
		var light=document.getElementById('lightSFtp');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
	if(type==fcCommunTypeFile){
		var light=document.getElementById('lightFile');
		var fade=document.getElementById('fade');
		light.style.display='none';
		fade.style.display='none';
	}
}

function confirm(type){
	var fcCommunParam=document.getElementById('fcCommunParam');
	fcCommunParam.value="";
	if(type==fcCommunTypeFtp){
		var ipFtp=document.getElementById('ipFtp');
		var portFtp=document.getElementById('portFtp');
		var userNameFtp=document.getElementById('userNameFtp');
		var passwordFtp=document.getElementById('passwordFtp');
		var workPathFtp=document.getElementById('workPathFtp');
		var destDirFtp=document.getElementById('destDirFtp');
		var needMoveFtp=document.getElementsByName('needMoveFtp');
		if(ipFtp.value!=""){		
			var v = ipFtp.value;
			fcCommunParam.value+=v.replace(/[$]/g,"\\$$")+"$";
		}else{
			alert('FTP Server IP 地址为必填项');
			return;
		}
		if(portFtp.value!=""){
			fcCommunParam.value+=portFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('FTP Server 端口号为必填项');
			return;
		}
		if(userNameFtp.value!=""){
			fcCommunParam.value+=userNameFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(passwordFtp.value!=""){
			fcCommunParam.value+=passwordFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(workPathFtp.value!=""){
			fcCommunParam.value+=workPathFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}		
		if(getRadioValue(needMoveFtp)!=""&&getRadioValue(needMoveFtp)!=null){
			fcCommunParam.value+=getRadioValue(needMoveFtp).replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('是否需要移动文件为必选项');
			return;
		}
		if(destDirFtp.value!=""){
			fcCommunParam.value+=destDirFtp.value.replace(/[$]/g,"\\$$");
		}else{
			if(getRadioValue(needMoveFtp)=="YES"){
				fcCommunParam.value="";
				alert('需要移动文件时候，移动文件的指定目录为必选项');
				return;
			}
		}		
	}
	if(type==fcCommunTypeFtps){
		var ipFtps=document.getElementById('ipFtps');
		var portFtps=document.getElementById('portFtps');
		var userNameFtps=document.getElementById('userNameFtps');
		var passwordFtps=document.getElementById('passwordFtps');
		var workPathFtps=document.getElementById('workPathFtps');
		var isImplicit=document.getElementsByName('isImplicit');
		var needClientCert=document.getElementById('needClientCert');
		var needServerCert=document.getElementById('needServerCert');
		var clientKeyStorePath=document.getElementById('clientKeyStorePath');
		var serverKeyStorePath=document.getElementById('serverKeyStorePath');
		var clientKeyStorePassword=document.getElementById('clientKeyStorePassword');
		var serverKeyStorePassword=document.getElementById('serverKeyStorePassword');
		var needMoveFtps=document.getElementsByName('needMoveFtps');
		var destDirFtps=document.getElementById('destDirFtps');
		if(ipFtps.value!=""){
			fcCommunParam.value+=ipFtps.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('FTPS Server IP 地址为必填项');
			return;
		}
		if(portFtps.value!=""){
			fcCommunParam.value+=portFtps.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('FTPS Server 端口号为必填项');
			return;
		}
		if(userNameFtps.value!=""){
			fcCommunParam.value+=userNameFtps.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(passwordFtps.value!=""){
			fcCommunParam.value+=passwordFtps.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(workPathFtps.value!=""){
			fcCommunParam.value+=workPathFtps.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(getRadioValue(isImplicit)!=""&&getRadioValue(isImplicit)!=null){
			fcCommunParam.value+=getRadioValue(isImplicit).replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('FTPS Server工作方式为必填项');
			return;
		}
		if(needClientCert.value!=""){
			fcCommunParam.value+=needClientCert.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('服务器是否需要验证客户端的证书为必填项');
			return;
		}		
		if(needServerCert.value!=""){
			fcCommunParam.value+=needServerCert.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('客户端是否需要验证服务器的证书为必填项');
			return;;
		}
		if(clientKeyStorePath.value!=""){
			fcCommunParam.value+=clientKeyStorePath.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(serverKeyStorePath.value!=""){
			fcCommunParam.value+=serverKeyStorePath.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(clientKeyStorePassword.value!=""){
			fcCommunParam.value+=clientKeyStorePassword.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(serverKeyStorePassword.value!=""){
			fcCommunParam.value+=serverKeyStorePassword.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(getRadioValue(needMoveFtps)!=""&&getRadioValue(needMoveFtps)!=null){
			fcCommunParam.value+=getRadioValue(needMoveFtps).replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('是否需要移动文件为必选项');
			return;
		}
		if(destDirFtps.value!=""){
			fcCommunParam.value+=destDirFtps.value.replace(/[$]/g,"\\$$");
		}else{
			if(getRadioValue(needMoveFtps)=="YES"){
				fcCommunParam.value="";
				alert('需要移动文件时候，移动文件的指定目录为必选项');
				return;
			}
		}
	}
	if(type==fcCommunTypeMsMQ){
		var ipMsMQ=document.getElementById('ipMsMQ');
		var queueNameMsMQ=document.getElementById('queueNameMsMQ');
		var trxTypeMsMQ=document.getElementById('trxTypeMsMQ');
		if(ipMsMQ.value!=""){
			
		}else{
			fcCommunParam.value="";
			alert('MQ服务器IP地址为必填项');
			return;
		}
		if(queueNameMsMQ.value!=""){
			
		}else{
			fcCommunParam.value="";
			alert('队列名称为必填项');
			return;
		}
		if(trxTypeMsMQ.value!=""){
			
		}else{
			fcCommunParam.value="";
			alert('队列事务类型为必选项');
			return;
		}
		fcCommunParam.value=trxTypeMsMQ.value+"$"+"DIRECT=TCP:"+ipMsMQ.value.replace(/[$]/g,"\\$$")+"\\\\private\\$\\\\"+queueNameMsMQ.value.replace(/[$]/g,"\\$$");
	}
	if(type==fcCommunTypeIBMMQ){
		var ipIBMMQ=document.getElementById('ipIBMMQ');
		var portIBMMQ=document.getElementById('portIBMMQ');
		var userNameIBMMQ=document.getElementById('userNameIBMMQ');
		var passwordIBMMQ=document.getElementById('passwordIBMMQ');
		var ccsidIBMMQ=document.getElementById('ccsidIBMMQ');
		var queueManagerIBMMQ=document.getElementById('queueManagerIBMMQ');
		var channelIBMMQ=document.getElementById('channelIBMMQ');
		var queueNameIBMMQ=document.getElementById('queueNameIBMMQ');
		if(ipIBMMQ.value!=""){
			fcCommunParam.value+=ipIBMMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('MQ服务器IP地址为必填项');
			return;
		}
		if(portIBMMQ.value!=""){
			fcCommunParam.value+=portIBMMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('MQ Server 端口号为必填项');
			return;
		}
		if(userNameIBMMQ.value!=""){
			fcCommunParam.value+=userNameIBMMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(passwordIBMMQ.value!=""){
			fcCommunParam.value+=passwordIBMMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(ccsidIBMMQ.value!=""){
			fcCommunParam.value+=ccsidIBMMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('Coded Character Set Identifier为必填项');
			return;
		}
		if(queueManagerIBMMQ.value!=""){
			fcCommunParam.value+=queueManagerIBMMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('队列管理器名称为必填项');
			return;
		}
		if(channelIBMMQ.value!=""){
			fcCommunParam.value+=channelIBMMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value="";
			alert('队列管理器对应的通道名称为必填项');
			return;
		}
		if(queueNameIBMMQ.value!=""){
			fcCommunParam.value+=queueNameIBMMQ.value.replace(/[$]/g,"\\$$");
		}else{
			fcCommunParam.value="";
			alert('队列名称为必填项');
			return;
		}
	}
	if(type==fcCommunTypeActiveMQ){
		var ipActiveMQ=document.getElementById('ipActiveMQ');
		var portActiveMQ=document.getElementById('portActiveMQ');
		var userNameActiveMQ=document.getElementById('userNameActiveMQ');
		var passwordActiveMQ=document.getElementById('passwordActiveMQ');
		var queueNameActiveMQ=document.getElementById('queueNameActiveMQ');
		if(ipActiveMQ.value!=""){
			fcCommunParam.value+="TCP://"+ipActiveMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			alert('ActiveMQ Server IP 地址为必填项');
			fcCommunParam.value="";
			return;
		}
		if(portActiveMQ.value!=""){
			fcCommunParam.value+=portActiveMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			alert('ActiveMQ Server 端口号为必填项');
			fcCommunParam.value="";
			return;
		}
		if(userNameActiveMQ.value!=""){
			fcCommunParam.value+=userNameActiveMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}	
		if(passwordActiveMQ.value!=""){
			fcCommunParam.value+=passwordActiveMQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}	
		if(queueNameActiveMQ.value!=""){
			fcCommunParam.value+=queueNameActiveMQ.value.replace(/[$]/g,"\\$$");
		}else{
			alert('队列名称为必选项');
			fcCommunParam.value="";
			return;
		}		
	}
	if(type==fcCommunTypeHornetQ){
		var ipHornetQ=document.getElementById('ipHornetQ');
		var portHornetQ=document.getElementById('portHornetQ');
		var queueNameHornetQ=document.getElementById('queueNameHornetQ');
		if(ipHornetQ.value!=""){
			fcCommunParam.value+=ipHornetQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			alert('HornetQ Server IP 地址为必填项');
			fcCommunParam.value="";
			return;
		}
		if(portHornetQ.value!=""){
			fcCommunParam.value+=portHornetQ.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			alert('HornetQ Server 端口号为必选项');
			fcCommunParam.value="";
			return;
		}
		if(queueNameHornetQ.value!=""){
			fcCommunParam.value+=queueNameHornetQ.value.replace(/[$]/g,"\\$$");
		}else{
			alert('队列名称为必填项');
			fcCommunParam.value="";
			return;
		}		
	}
	if(type==fcCommunTypeSFtp){
		var ipSFtp=document.getElementById('ipSFtp');
		var portSFtp=document.getElementById('portSFtp');
		var userNameSFtp=document.getElementById('userNameSFtp');
		var passwordSFtp=document.getElementById('passwordSFtp');
		var workPathSFtp=document.getElementById('workPathSFtp');
		var validation=document.getElementsByName('validation');
		var knownHosts=document.getElementById('knownHosts');
		if(ipSFtp.value!=""){
			fcCommunParam.value+=ipSFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			alert('SFTP Server IP 地址为必填项');
			fcCommunParam.value="";
			return;
		}
		if(portSFtp.value!=""){
			fcCommunParam.value+=portSFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			alert('队列名称为必填项');
			fcCommunParam.value="";
			return;
		}
		if(userNameSFtp.value!=""){
			fcCommunParam.value+=userNameSFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}	
		if(passwordSFtp.value!=""){
			fcCommunParam.value+=passwordSFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(workPathSFtp.value!=""){
			fcCommunParam.value+=workPathSFtp.value.replace(/[$]/g,"\\$$")+"$";
		}else{
			fcCommunParam.value+="$";
		}
		if(getRadioValue(validation)!="" && getRadioValue(validation)!=null){
			fcCommunParam.value+=getRadioValue(validation)+"$";
		}else{
			alert('必须选择是否需要验证服务器');
			fcCommunParam.value="";
			return;
		}
		if(knownHosts.value!=""){
			fcCommunParam.value+=knownHosts.value.replace(/[$]/g,"\\$$");
		}else{
		}
	}
	if(type==fcCommunTypeFile){
		var directory=document.getElementById('directory');
		if(directory.value!=""){
			fcCommunParam.value+=directory.value.replace(/[$]/g,"\\$$");
		}else{
			alert('访问的目录路径（相对路径）为必填项');
			fcCommunParam.value="";
			return;
		}
	}
	
	hide(type);
}
function resetCommunParam(){
	document.getElementById('fcCommunParam').value="";
}
function showEdit(){
	var fcCommunType = document.getElementById('fcCommunType');
	var fcCommunParam=document.getElementById('fcCommunParam');
	if(fcCommunType.value!=""){
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeFtp){
			var v= splitCommunParam(fcCommunParam.value);
			var length=v.length;
			for(var i=0;i<length;i++){
				var ipFtp=document.getElementById('ipFtp');
				ipFtp.value=v[0];
				var portFtp=document.getElementById('portFtp');
				portFtp.value=v[1];
				var userNameFtp=document.getElementById('userNameFtp');
				userNameFtp.value=v[2];
				var passwordFtp=document.getElementById('passwordFtp');
				passwordFtp.value=v[3];
				var workPathFtp=document.getElementById('workPathFtp');
				workPathFtp.value=v[4];
				var needMoveFtp=document.getElementsByName('needMoveFtp');
				setRadioValue(needMoveFtp,v[5]);
				var destDirFtp=document.getElementById('destDirFtp');
				destDirFtp.value=v[6];
			}
			var light=document.getElementById('lightFtp');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeFtps){
			var v= splitCommunParam(fcCommunParam.value);
			var length=v.length;
			for(var i=0;i<length;i++){
				var ipFtps=document.getElementById('ipFtps');
				ipFtps.value=v[0];
				var portFtps=document.getElementById('portFtps');
				portFtps.value=v[1];
				var userNameFtps=document.getElementById('userNameFtps');
				userNameFtps.value=v[2];
				var passwordFtps=document.getElementById('passwordFtps');
				passwordFtps.value=v[3];
				var workPathFtps=document.getElementById('workPathFtps');
				workPathFtps.value=v[4];
				var isImplicit=document.getElementsByName('isImplicit');
				setRadioValue(isImplicit,v[5]);
				var needClientCert=document.getElementById('needClientCert');
				needClientCert.value=v[6];
				var needServerCert=document.getElementById('needServerCert');
				needServerCert.value=v[7];
				var clientKeyStorePath=document.getElementById('clientKeyStorePath');
				clientKeyStorePath.value=v[8];
				var serverKeyStorePath=document.getElementById('serverKeyStorePath');
				serverKeyStorePath.value=v[9];
				var clientKeyStorePassword=document.getElementById('clientKeyStorePassword');
				clientKeyStorePassword.value=v[10];
				var serverKeyStorePassword=document.getElementById('serverKeyStorePassword');
				serverKeyStorePassword.value=v[11];
				var needMoveFtps=document.getElementsByName('needMoveFtps');
				setRadioValue(needMoveFtps,v[12]);
				var destDirFtps=document.getElementById('destDirFtps');
				destDirFtps.value=v[13];
			}			
			var light=document.getElementById('lightFtps');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeMsMQ){
			var v= splitCommunParam(fcCommunParam.value);
			
			/*var length=v.length;
			 var ipMsMQ=document.getElementById('ipMsMQ');
			ipMsMQ.value=v[0];
			var queueNameMsMQ=document.getElementById('queueNameMsMQ');
			queueNameMsMQ.value=v[1];
			var trxTypeMsMQ=document.getElementById('trxTypeMsMQ');
			trxTypeMsMQ.value=v[2];*/
			var trxTypeMsMQ=document.getElementById('trxTypeMsMQ');
			trxTypeMsMQ.value=v[0];
			var ipMsMQ=document.getElementById('ipMsMQ');
			var index = v[1].indexOf("\\");
			var lastIndex = v[1].indexOf("\\",index+1);
			ipMsMQ.value=v[1].substring(11,index);
			var queueNameMsMQ=document.getElementById('queueNameMsMQ');
			queueNameMsMQ.value=v[1].substring(lastIndex+3);
			
			var light=document.getElementById('lightMsMQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeIBMMQ){
			var v= splitCommunParam(fcCommunParam.value);
			var length=v.length;
			for(var i=0;i<length;i++){
				var ipIBMMQ=document.getElementById('ipIBMMQ');
				ipIBMMQ.value=v[0];
				var portIBMMQ=document.getElementById('portIBMMQ');
				portIBMMQ.value=v[1];
				var userNameIBMMQ=document.getElementById('userNameIBMMQ');
				userNameIBMMQ.value=v[2];
				var passwordIBMMQ=document.getElementById('passwordIBMMQ');
				passwordIBMMQ.value=v[3];
				var ccsidIBMMQ=document.getElementById('ccsidIBMMQ');
				ccsidIBMMQ.value=v[4];
				var queueManagerIBMMQ=document.getElementById('queueManagerIBMMQ');
				queueManagerIBMMQ.value=v[5];
				var channelIBMMQ=document.getElementById('channelIBMMQ');
				channelIBMMQ.value=v[6];
				var queueNameIBMMQ=document.getElementById('queueNameIBMMQ');
				queueNameIBMMQ.value=v[7];
			}
			var light=document.getElementById('lightIBMMQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeActiveMQ){
			var v= splitCommunParam(fcCommunParam.value);
			var length=v.length;
			for(var i=0;i<length;i++){
				var ipActiveMQ=document.getElementById('ipActiveMQ');
				ipActiveMQ.value=v[0].substring(6);
				var portActiveMQ=document.getElementById('portActiveMQ');
				portActiveMQ.value=v[1];
				var userNameActiveMQ=document.getElementById('userNameActiveMQ');
				userNameActiveMQ.value=v[2];
				var passwordActiveMQ=document.getElementById('passwordActiveMQ');
				passwordActiveMQ.value=v[3];
				var queueNameActiveMQ=document.getElementById('queueNameActiveMQ');
				queueNameActiveMQ.value=v[4];
			}
			var light=document.getElementById('lightActiveMQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeHornetQ){
			var v= splitCommunParam(fcCommunParam.value);
			var length=v.length;
			for(var i=0;i<length;i++){
				var ipHornetQ=document.getElementById('ipHornetQ');
				ipHornetQ.value=v[0];
				var portHornetQ=document.getElementById('portHornetQ');
				portHornetQ.value=v[1];
				var queueNameHornetQ=document.getElementById('queueNameHornetQ');
				queueNameHornetQ.value=v[2];
			}
			var light=document.getElementById('lightHornetQ');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeSFtp){
			var v= splitCommunParam(fcCommunParam.value);
			var length=v.length;
			for(var i=0;i<length;i++){
				var ipSFtp=document.getElementById('ipSFtp');
				ipSFtp.value=v[0];
				var portSFtp=document.getElementById('portSFtp');
				portSFtp.value=v[1];
				var userNameSFtp=document.getElementById('userNameSFtp');
				userNameSFtp.value=v[2];
				var passwordSFtp=document.getElementById('passwordSFtp');
				passwordSFtp.value=v[3];
				var workPathSFtp=document.getElementById('workPathSFtp');
				workPathSFtp.value=v[4];
				var validation=document.getElementsByName('validation');
				setRadioValue(validation,v[5]);
				var knownHosts=document.getElementById('knownHosts');
				knownHosts.value=v[6];
			}
			var light=document.getElementById('lightSFtp');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
		if(fcCommunType.value.toLowerCase()==fcCommunTypeFtp||fcCommunType.value.toUpperCase()==fcCommunTypeFile){
			var v= splitCommunParam(fcCommunParam.value);
			var length=v.length;
			for(var i=0;i<length;i++){
				var directory=document.getElementById('directory');
				directory.value=v[0];
			}
			var light=document.getElementById('lightFile');
			var fade=document.getElementById('fade');
			light.style.display='block';
			fade.style.display='block';
		}
	}
}